﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Tasks.aspx.cs" Inherits="EuroAudit.Tasks" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Uzdevumi</title>
    <script type="text/javascript">
    
      function pageLoad() {
      }
      function DelTask() {
          var MessageSource = "cmdDelTask";
          var MessageText = "Uzdevums tiks dzēsts. Vai turpināt?";
          document.getElementById("lblDelTask").style.visibility = "visible";
          document.getElementById("cmdDelOKTask").style.visibility = "visible";
          document.getElementById("lblDelMsg").style.visibility = "hidden";
          document.getElementById("cmdDelOKMsg").style.visibility = "hidden";
          //OpenModal(MessageSource, MessageText);
          overlay();

      }
      function DelMessage() {
          var MessageSource = "cmdDelMsg";
          var MessageText = "Ziņojums tiks dzēsts. Vai turpināt?";
          document.getElementById("lblDelTask").style.visibility = "hidden";
          document.getElementById("cmdDelOKTask").style.visibility = "hidden";
          document.getElementById("lblDelMsg").style.visibility = "visible";
          document.getElementById("cmdDelOKMsg").style.visibility = "visible";

          //OpenModal(MessageSource, MessageText);
          overlay();

      }
      function OpenModal(MessageSource, MessageText) {
          //var MessageSource = "cmdDel";
          //var MessageText = "Struktūras ieraksts tiks dzēsts. Vai turpināt?";
          var WinSettings = "center:yes;resizable:no;dialogHeight:200px;status:no";
          var RetVal = window.showModalDialog("ModalDlg.aspx", MessageText, WinSettings);
          //__doPostBack("cmdDelLn", "");
          //__doPostBack("cmdDel","");
          //$get('cmdDel').click();
          if (document.getElementById("_RESULT").textContent != "undefined")
              document.getElementById("_RESULT").textContent = RetVal + MessageSource;
          if (document.getElementById("_RESULT").innerText != "undefined")
              document.getElementById("_RESULT").innerText = RetVal + MessageSource;
          //document.getElementById('_RESULT').innerText = RetVal + MessageSource;
          __doPostBack('_RESULT', '');
          //RefreshIndex();
      }
      function overlay() {
          xyz = document.getElementById("overlay");
          xyz.style.visibility = (xyz.style.visibility == "visible") ? "hidden" : "visible";

      }
    </script>
    <link href="Style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 209px;
        }
        .style2
        {
            width: 152px;
        }
        .style3
        {
            width: 150px;
        }
    </style>
</head>
<body class="PageMain">


    <form id="form1" runat="server">
    <div id="overlay">
        <div align="center">
            <asp:Label ID="lblDelTask" runat="server" CssClass="LabelFieldCaption" Text="Uzdevums tiks dzēsts. Vai turpināt?"></asp:Label>
            <asp:Label ID="lblDelMsgp" runat="server" CssClass="LabelFieldCaption" Text="Ziņojums tiks dzēsta. Vai turpināt?"></asp:Label>
            <br />
            <asp:Button ID="cmdDelOKTask" runat="server" CssClass="cmdDel" OnClientClick="overlay()"
                OnClick="cmdDelTask_Click" Text="OK" />
            <asp:Button ID="cmdDelOKMsg" runat="server" CssClass="cmdDel" OnClientClick="overlay()"
                OnClick="cmdDelMsg_Click" Text="OK" />
            <asp:Button ID="cmdDelCancel" runat="server" CssClass="cmdClose" OnClientClick="overlay()"
                Text="Cancel" />
        </div>
    </div>    
    <div align="center">
        <asp:Label ID="Label1" runat="server" CssClass="LabelPageCaption" 
            Text="Ziņojumi un uzdevumi"></asp:Label>
        <br />
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    </div>
    <div >
        <asp:Button ID="cmdNewMsg" runat="server" CssClass="cmdNew" 
            Text="Jauns ziņojums" onclick="cmdNewMsg_Click" />
&nbsp;<asp:Button ID="cmdNew" runat="server" Text="Jauns uzdevums" CssClass="cmdNew" 
            onclick="cmdNew_Click" />
        &nbsp;<asp:Button ID="cmdShowOpt" runat="server" CssClass="cmdEdit" 
            onclick="cmdShowOpt_Click" Text="Uzstādījumi" />
                        <asp:TextBox ID="_RESULT" runat="server" 
            CssClass="FieldsUnvisible"></asp:TextBox>
        <br />
        <asp:UpdatePanel ID="upOptions" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Panel ID="pOptions" runat="server" CssClass="PanelEdit" Height="412px" 
                    Visible="False" Width="826px" BorderColor="#6699FF" BorderStyle="Solid">
                    <asp:Panel ID="pFilters" runat="server" Height="162px" HorizontalAlign="Center" 
                        BorderColor="#6699FF" BorderStyle="Solid">
                        <asp:Label ID="Label18" runat="server" CssClass="LabelFieldCaption" 
                            Text="Filtri"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtMsgTypeFilt" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                        <asp:TextBox ID="txtOpWhere" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                        <asp:TextBox ID="txtOpOrder" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                        <br />
                        <table style="width:100%;">
                            <tr>
                                <td>
                                    <asp:Label ID="Label22" runat="server" CssClass="LabelFieldCaption" 
                                        Text="Ailes nosaukums"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label23" runat="server" CssClass="LabelFieldCaption" 
                                        Text="Darbība"></asp:Label>
                                </td>
                                <td class="style1">
                                    <asp:Label ID="Label24" runat="server" CssClass="LabelFieldCaption" 
                                        Text="Vērtība"></asp:Label>
                                </td>
                                <td class="style2">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlFieldFilt" runat="server" Width="100%">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlDarbFilt" runat="server" Width="100%">
                                    </asp:DropDownList>
                                </td>
                                <td class="style1">
                                    <asp:TextBox ID="txtValueFilt" runat="server" Width="100%"></asp:TextBox>
                                </td>
                                <td class="style2">
                                    <asp:Button ID="cmdAddFilt" runat="server" CssClass="cmdSave" 
                                        Text="Pievienot" onclick="cmdAddFilt_Click" />
                                </td>
                            </tr>
                        </table>
                        <br />
                        <asp:Table ID="tFilters" runat="server" GridLines="Both" Width="100%">
                        </asp:Table>
                    </asp:Panel>
                    <asp:Panel ID="pSort" runat="server" Height="157px" HorizontalAlign="Center" 
                        BorderColor="#6699FF" BorderStyle="Solid">
                        <asp:Label ID="Label25" runat="server" CssClass="LabelFieldCaption" 
                            Text="Kārtošana"></asp:Label>
                        <br />
                        <br />
                        <table style="width:100%;">
                            <tr>
                                <td>
                                    <asp:Label ID="Label26" runat="server" CssClass="LabelFieldCaption" 
                                        Text="Ailes nosaukums"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label27" runat="server" CssClass="LabelFieldCaption" 
                                        Text="Darbība"></asp:Label>
                                </td>
                                <td class="style3">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlFieldSort" runat="server" style="margin-right: 0px" 
                                        Width="100%">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlDarbSort" runat="server" Width="100%">
                                        <asp:ListItem Selected="True" Value="ASC">Augoši</asp:ListItem>
                                        <asp:ListItem Value="DESC">Dilstoši</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td class="style3">
                                    <asp:Button ID="cmdAddSort" runat="server" CssClass="cmdSave" 
                                        Text="Pievienot" onclick="cmdAddSort_Click" />
                                </td>
                            </tr>
                        </table>
                        <br />
                        <asp:Table ID="tSort" runat="server" GridLines="Both" Width="100%">
                        </asp:Table>
                    </asp:Panel>
                    <br />
                    
                    <asp:UpdatePanel ID="upOptCmd" runat="server" UpdateMode="Conditional" >
                        <ContentTemplate>
                            <div align="center" style="height: 57px">
                                &nbsp;<asp:Label ID="lblErrOptions" runat="server" CssClass="LabelError"></asp:Label>
                                <br />
                                <asp:Button ID="cmdSaveOpt" runat="server"  
                                    Text="Saglabāt" CssClass="cmdSave" onclick="cmdSaveOpt_Click" 
                                    Visible="False" />
                                &nbsp;<asp:Button ID="cmdCloseOpt" runat="server" CssClass="cmdClose" 
                                     Text="Aizvērt" onclick="cmdCloseOpt_Click" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upMsg" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pMsg" runat="server" CssClass="PanelEdit" Height="503px" 
                    Visible="False">
                    <asp:TextBox ID="txtID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <a name="pMsg"></a>
                    <br />
                    <asp:Label ID="Label2" runat="server" CssClass="LabelFieldCaption" 
                        Text="Adresāti"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTo" runat="server" CssClass="FieldsText" ReadOnly="True"></asp:TextBox>
                    <asp:Button ID="cmdShowUser" runat="server" CssClass="cmdShowLists" 
                        onclick="cmdShowUser_Click" Text="..." />
                    <asp:GridView ID="gvAccessU" runat="server" AutoGenerateSelectButton="True" 
                        onselectedindexchanged="gvAccessU_SelectedIndexChanged" Visible="False">
                    </asp:GridView>
                    <br />
                    <asp:Label ID="Label3" runat="server" CssClass="LabelFieldCaption" Text="Tēma"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtName" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label4" runat="server" CssClass="LabelFieldCaption" 
                        Text="Ziņojums"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtDetail" runat="server" CssClass="FieldsText" Height="135px" 
                        TextMode="MultiLine"></asp:TextBox>
                    <br />
                    <asp:CheckBox ID="chbSendMailMsg" runat="server" CssClass="CheckBox" 
                        Text="Nosūtīt kopiju uz e-pastu" />
                    <asp:UpdatePanel ID="upMsgCmd" runat="server" UpdateMode="Conditional" >
                        <ContentTemplate>
                            <div align="center">
                                <asp:Label ID="lblErrMsg" runat="server" CssClass="LabelError"></asp:Label>
                                <br />
                                <asp:Button ID="cmdSendMsg" runat="server" CssClass="cmdSave" 
                                    onclick="cmdSendMsg_Click" Text="Nosūtīt" />
                                &nbsp;<asp:Button ID="cmdDelMsg" runat="server" CssClass="cmdDel" 
                                    onclick="cmdDelMsg_Click" Text="Dzēst" Visible="False" />
                                <asp:Button ID="cmdDelModMsg" runat="server" CssClass="cmdDel" 
                                    onclientclick="DelMessage()" Text="Dzēst" />
                                &nbsp;<asp:Button ID="cmdCloseMsg" runat="server" CssClass="cmdClose" 
                                    onclick="cmdCloseMsg_Click" Text="Aizvērt" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <br />
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upTaskReport" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pTaskReport" runat="server" CssClass="PanelEdit" Height="665px" Visible="False">
                    <asp:TextBox ID="txtTaskVarR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtTaskIDR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtSTaskIDR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtSTaskPathR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtRecStatusR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtParentTaskPathR" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <a name="pTaskReport"></a>
                    <br />
                    <asp:Label ID="Label11" runat="server" CssClass="LabelFieldCaption" Text="No"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskFromR" runat="server" CssClass="FieldsTextReadOnly" 
                        ReadOnly="True"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label12" runat="server" CssClass="LabelFieldCaption" Text="Kam"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskToR" runat="server" CssClass="FieldsText" 
                        ReadOnly="True"></asp:TextBox>

                    <br />

                    <asp:Label ID="Label13" runat="server" CssClass="LabelFieldCaption" 
                        Text="Termiņš"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskEndTimeR" runat="server" CssClass="FieldsText" 
                        ReadOnly="True"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label14" runat="server" CssClass="LabelFieldCaption" 
                        Text="Uzdevuma nosaukums"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskNameR" runat="server" CssClass="FieldsText" 
                        ReadOnly="True"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label15" runat="server" CssClass="LabelFieldCaption" 
                        Text="Uzdevuma apraksts"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskDetailR" runat="server" CssClass="FieldsText" 
                        Height="138px" TextMode="MultiLine" ReadOnly="True"></asp:TextBox>
                    <br />
                    <br />
                    <asp:CheckBox ID="cbCompletedR" runat="server" AutoPostBack="True" 
                        CssClass="CheckBox"  
                        oncheckedchanged="cbCompletedR_CheckedChanged" Text="Izpildīts:" />
                    &nbsp;<asp:Label ID="lblCompletedTimeR" runat="server" Width="200px"></asp:Label>
                    <br />
                    <asp:Label ID="Label17" runat="server" CssClass="LabelFieldCaption" 
                        Text="Atskaite"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskReportR" runat="server" CssClass="FieldsText" 
                        Height="136px" TextMode="MultiLine"></asp:TextBox>
                    <br />
                    <br />
                    <asp:CheckBox ID="cbSendTaskByMailR" runat="server" CssClass="CheckBox" 
                        Text="Nosūtīt kopiju uz e-pastu" />
                    <br />
                    <div align="center">
                        <asp:Label ID="lblTaskErrorR" runat="server" CssClass="LabelError"></asp:Label>
                        <br />
                        <asp:Button ID="cmdSaveTaskR" runat="server" CssClass="cmdSave" 
                            onclick="cmdSaveTaskR_Click" Text="Saglabāt" />
                        &nbsp;<asp:Button ID="cmdCloseTaskR" runat="server" CssClass="cmdClose" 
                            onclick="cmdCloseTaskR_Click" Text="Aizvērt" />
                    </div>
                </asp:Panel>
            
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upTask" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pTask" runat="server" CssClass="PanelEdit" Height="1056px" 
                    Visible="False">
                    <asp:TextBox ID="txtTaskVar" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtTaskID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtSTaskID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtSTaskPath" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtRecStatus" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtParentTaskPath" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <a name="pTask"></a>
                    <br />
                    <asp:Label ID="Label6" runat="server" CssClass="LabelFieldCaption" Text="No"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskFrom" runat="server" CssClass="FieldsTextReadOnly"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label7" runat="server" CssClass="LabelFieldCaption" Text="Kam"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskTo" runat="server" CssClass="FieldsText"></asp:TextBox>
                    &nbsp;<asp:Button ID="cmdTaskTo" runat="server" CssClass="cmdShowLists" 
                        onclick="cmdTaskTo_Click" Text="..." />
                    <asp:GridView ID="gvTaskTo" runat="server" AutoGenerateSelectButton="True" 
                        onselectedindexchanged="gvTaskTo_SelectedIndexChanged" Visible="False">
                    </asp:GridView>
                    <br />
                    <asp:Label ID="Label8" runat="server" CssClass="LabelFieldCaption" 
                        Text="Termiņš"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskEndTime" runat="server" CssClass="FieldsText"></asp:TextBox>
                    &nbsp;<asp:Button ID="cmdTaskEndTime" runat="server" CssClass="cmdShowLists" 
                        onclick="cmdTaskEndTime_Click" Text="..." />
                    <asp:Calendar ID="cTaskEndTime" runat="server" 
                        onselectionchanged="cTaskEndTime_SelectionChanged" Visible="False">
                        <SelectedDayStyle Font-Bold="True" />
                        <TodayDayStyle BackColor="Red" Font-Bold="True" />
                    </asp:Calendar>
                    <br />
                    <asp:Label ID="Label5" runat="server" CssClass="LabelFieldCaption" 
                        Text="Uzdevuma nosaukums"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskName" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label9" runat="server" CssClass="LabelFieldCaption" 
                        Text="Uzdevuma apraksts"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskDetail" runat="server" CssClass="FieldsText" 
                        Height="138px" TextMode="MultiLine"></asp:TextBox>
                    <br />
                    <br />
                    <asp:CheckBox ID="cbCompleted" runat="server" AutoPostBack="True" 
                        CssClass="CheckBox" Enabled="False" 
                        oncheckedchanged="cbCompleted_CheckedChanged" Text="Izpildīts:" />
                    &nbsp;<asp:Label ID="lblCompletedTime" runat="server" Width="200px"></asp:Label>
                    <br />
                    <asp:Label ID="Label10" runat="server" CssClass="LabelFieldCaption" 
                        Text="Atskaite"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtTaskReport" runat="server" CssClass="FieldsText" 
                        Height="136px" ReadOnly="True" TextMode="MultiLine"></asp:TextBox>
                    <br />
                    <br />
                    <asp:CheckBox ID="cbSendTaskByMail" runat="server" CssClass="CheckBox" 
                        Text="Nosūtīt kopiju uz e-pastu" />
                    <br />
                    <div align="center">
                        <asp:Label ID="lblTaskError" runat="server" CssClass="LabelError"></asp:Label>
                        <br />
                        <asp:Button ID="cmdSaveTask" runat="server" CssClass="cmdSave" 
                            onclick="cmdSaveTask_Click" Text="Saglabāt" />
                        &nbsp;<asp:Button ID="cmdNewChildTask" runat="server" CssClass="cmdNew" 
                            onclick="cmdNewChildTask_Click" Text="Jauns apakšuzdevums" />
                        &nbsp;<asp:Button ID="cmdDelTask" runat="server" CssClass="cmdDel" 
                            onclick="cmdDelTask_Click" Text="Dzēst" Visible="False" />
                        <asp:Button ID="cmdDelModTask" runat="server" CssClass="cmdDel" 
                            onclientclick="DelTask()" Text="Dzēst" />
                        &nbsp;<asp:Button ID="cmdCloseTask" runat="server" CssClass="cmdClose" 
                            onclick="cmdCloseTask_Click" Text="Aizvērt" />
                    </div>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upDetails" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Panel ID="pMsgDetails" runat="server" CssClass="PanelEdit" Height="300px" 
                    Visible="False" Width="693px">
                    <a name="pMsgDetails"></a>
                    <asp:Table ID="tDetails" runat="server" GridLines="Horizontal">
                    </asp:Table>
                    <asp:TextBox ID="txtMsgID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtMsgType" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <br />
                    <asp:Label ID="lblReply" runat="server" CssClass="LabelFieldCaption" 
                        Text="Atbilde"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtReply" runat="server" CssClass="FieldsText" Height="137px" 
                        TextMode="MultiLine" Width="95%"></asp:TextBox>
                    <br />
                    <asp:CheckBox ID="chbReplyAll" runat="server" CssClass="CheckBox" 
                        Text="Atbildēt visiem" />
                    <br />
                    <asp:CheckBox ID="chbSendMail" runat="server" CssClass="CheckBox" 
                        Text="Nosūtīt kopiju uz e-pastu" />
                    <asp:UpdatePanel ID="upDetailsCmd" runat="server" UpdateMode="Conditional" >
                        <ContentTemplate>
                            <div align="center">
                                &nbsp;<asp:Label ID="lblErrDetail" runat="server" CssClass="LabelError"></asp:Label>
                                <br />
                                <asp:Button ID="cmdReply" runat="server" onclick="cmdReply_Click" 
                                    Text="Nosūtīt" CssClass="cmdSave" />
                                <asp:Button ID="cmdCloseDetail" runat="server" CssClass="cmdClose" 
                                    onclick="cmdCloseDetail_Click" Text="Aizvērt" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upTskDetails" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Panel ID="pTskDetails" runat="server" CssClass="PanelEdit" Height="107px" 
                    Visible="False" Width="693px">
                    <a name="pTskDetails"></a>
                    <asp:Table ID="tTskDetails" runat="server" GridLines="Horizontal">
                    </asp:Table>
                    <asp:TextBox ID="txtTskID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <asp:TextBox ID="txtTskType" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <br />
                    
                    <asp:UpdatePanel ID="upTskCmd" runat="server" UpdateMode="Conditional" >
                        <ContentTemplate>
                            <div align="center">
                                &nbsp;<asp:Label ID="lblErrTsk" runat="server" CssClass="LabelError"></asp:Label>
                                <br />
                                <asp:Button ID="cmdSaveTskDet" runat="server"  
                                    Text="Saglabāt" CssClass="cmdSave" Visible="False" 
                                    onclick="cmdSaveTskDet_Click" />
                                <asp:Button ID="cmdCloseTskDet" runat="server" CssClass="cmdClose" 
                                     Text="Aizvērt" onclick="cmdCloseTskDet_Click" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="upList" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Panel ID="pList" runat="server">
                    <br />
                    <table style="width:100%;">
                        <tr>
                        <td>
                        <asp:Button ID="cmdListMsgIn" runat="server" CssClass="cmdTabs" 
                            onclick="cmdListMsgIn_Click" Text="Saņemtie ziņojumi" />
                        </td>
                        <td>
                        <asp:Button ID="cmdListMsgOut" runat="server" CssClass="cmdTabs" 
                            onclick="cmdListMsgOut_Click" Text="Nosūtītie ziņojumi" />
                        </td>
                        <td>
                        <asp:Button ID="cmdListTasksIn" runat="server" CssClass="cmdTabs" 
                            onclick="cmdListTasksIn_Click" Text="Saņemtie uzdevumi" />
                        </td>
                        <td>                        
                        <asp:Button ID="cmdListTasksOut" runat="server" CssClass="cmdTabs" 
                            onclick="cmdListTasksOut_Click" Text="Nosūtītie uzdevumi" />
                        </td>
                        </tr>
                    </table>
                </asp:Panel>
                
                <asp:GridView ID="gvList" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="1px" 
                    EnableSortingAndPagingCallbacks="True" ondatabound="gvList_DataBound" 
                    CssClass="TableList">
                    <RowStyle BorderStyle="Solid" BorderWidth="1px" />
                </asp:GridView>
                <asp:Table ID="tList" runat="server" GridLines="Horizontal">
                    <asp:TableRow ID="tr1" runat="server">
                        <asp:TableCell runat="server" ColumnSpan="2" RowSpan="6">-</asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tr2" runat="server">
                        <asp:TableCell runat="server" ColumnSpan="2">-</asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tr3" runat="server">
                        <asp:TableCell runat="server" ColumnSpan="3">+</asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tr4" runat="server">
                        <asp:TableCell runat="server">-</asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tr5" runat="server">
                        <asp:TableCell runat="server" ColumnSpan="2">+</asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                        <asp:TableCell runat="server"></asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="cmdCloseDetail" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdCloseMsg" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdCloseTask" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdCloseTaskR" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdCloseTskDet" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdDelMsg" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdDelTask" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdSaveTask" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdSaveTaskR" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdSaveTskDet" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdReply" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdSendMsg" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="cmdSaveOpt" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <br />
    </div>
    </form>
    
</body>
</html>
